TdrDefinition

检查指定的xml/tdr/proto文件定义的表

检查指定的xml/tdr文件是否满足tdr规范,并返回文件中定义的表的集合。

请求地址

POST
http://OmsAddress/app/newoms.php/webservice/tdr/definition?cmd=10001&ip-type=webservicerest&attachment_id=4,5&access-token=AccessTokenVal&app_id=2

// 例子中的 attachment_id=4,5&app_id=2 需要修改为你自己的文件ID和业务ID

url中GET参数说明

字段名称 数据类型 说明 是否为必填字段 备注
attachment_id 字符串 要检查的文件的id,多个用逗号","拼接,文件id通过接口 上传定义表结构的xml/tdr/proto文件操作 获取,也可以在tcaplus oms的添加表、或者修改表页面【从已上传文件中添加】中获取
app_id number 业务ID

返回语法

返回参数说明

字段名称 数据类型 说明 备注
meta 字符串 表名
meta_check 字符串 表名检查ok
generic_check 布尔 当前表是否可以添加为generic表
generic_error 字符串 当前表不可以添加为generic表的原因描述
list_check 布尔 当前表是否可以添加为list表
list_error 字符串 当前表不可以添加为list表的原因描述
check_count_with_refer 布尔 检查 是否定义了Count 和 Refer proto文件pb表加表不返回此参数
value_field_num 整型 当前表的value字段数量
table_type_info json 当前表类型属性等customattr2相关属性定义信息

请求示例

通过 curl 方法发起请求

命令中的参数请参考本页中的“POST请求参数说明”,access-token的获取方法详见:获取access-token

curl -H "Content-type: application/json" -X "POST" http://omsaddress/app/newoms.php/webservice/tdr/definition?cmd=10001&ip-type=webservicerest&attachment_id=AttachmentID&access-token=<access-token>

返回示例

成功返回示例

http请求的Status=200

{
    "ActionAvartarInfo": {
        "generic_check": true,
        "list_check": true,
        "meta": "ActionAvartarInfo",
        "meta_check": true,
        "check_count_with_refer": true,
        "generic_error": "There is no Primaykey in meta:'ActionAvartarInfo', maybe it is a pure struct.",
        "list_error": "There is no Primaykey in meta:'ActionAvartarInfo', maybe it is a pure struct.",
        "value_field_num": 2,
        "table_type_info":{"TableType":"1","ListNum":"1023","SortFieldNum":"1","SortRule":"1","DataProtocolType":"TBD","error":false,"old_table_define":false}
    },
    "ActivityCfg": {
        "generic_check": true,
        "list_check": false,
        "meta": "ActivityCfg",
        "meta_check": true,
        "check_count_with_refer": true,
        "list_error": "list-type-table isn't allowed to configure index field! table:'ActivityCfg'",
        "value_field_num": 18,
        "table_type_info":{"error":false,"old_table_define":true}
    }
}

错误返回

http请求的Status!=200

[
    "元素的path不正确,不能正确匹配meta中的元素"
]
{
    "source_ip": "ip:10.29.89.51 not in whitelist"
}

results matching ""

    No results matching ""